#include"result.h"
Result::Result(std::shared_ptr<Task> task ,bool isValid ):task_(task ),isValid_(isValid)
{
  task->SetResult(this);
}
Any Result::get()
{
    if(!isValid_)
    {
        return "";
    }
    sem_.Wait();
    return std::move(any_);
}
void Result::SetVal(Any any)
{
    this->any_= std::move(any);
    sem_.Post();
}
